<template>
    <div class="div">
        &nbsp;&nbsp;实验数据
    </div>
    <table id="target" cellspacing="1" style="width: 100%;height: 150px;border: 1px solid #a8aeb2;">
        <tr class="tr" v-for="targs in labRecordTargList">
            <th v-for="targ in targs.labItemsTempTargetList"
                :class="{ 'thE': targ.fieldInput === '0', 'thF': targ.fieldInput === '1' }"
                :rowspan="targ.fieldRowspan > 0 ? targ.fieldRowspan : 1"
                :colspan="targ.fieldColspan > 0 ? targ.fieldColspan : 1">
                <span v-if="targ.fieldInput === '0'">{{ targ.fieldName }}</span>
                <a-input v-else-if="targ.fieldInput === '1'" v-model:value="targ.fieldValue" size="large" class="input" />
            </th>
        </tr>
    </table>
</template>
  
<script lang="ts" setup>

const props = defineProps<{
    labRecordTargList?: [{
        tId: String | number,
        itemsRecordTargetList: [{
            id: String | number,
            createBy: String,
            createTime: String,
            updateBy: String,
            updateTime: String,
            sysOrgCode: String,
            taskId: String,
            itemId: String,
            fieldName: String,
            fieldCode: String,
            fieldValue: String,
            fieldRule: String,
            fieldInput: String | number,
            fieldSort: number,
            fieldType: String,
            fieldRow: number,
            fieldCol: number,
            fieldRowspan: number,
            fieldColspan: number,
        }]
    }],
}>();

defineExpose({
    props,
});

</script>
  
<style scoped>
.div {
    height: 45px;
    border: 1px solid #a8aeb2;
    background-color: #d2d5d6;
    text-align: left;
    font: 1.2em sans-serif;
    line-height: 45px
}

.tr {
    height: 50px;
    border: 1px solid #a8aeb2;
}


.thE {
    /* width: 25%; */
    text-align: center;
    border: 1px solid #a8aeb2;
    font: 1.2em sans-serif;
}

.thG {
    text-align: center;
    border: 1px solid #a8aeb2;
    font: 1.2em sans-serif;
    ;
}

.thF {
    text-align: center;
    border: 1px solid #a8aeb2;
    font: 1.2em sans-serif;
}

.input {
    width: 100%;
    height: 100%;
    border: none;
    background-color: inherit;
    outline: none;
    border-bottom: none;
}
</style>